require "base/internal/ui/reflexcore"

MgHUD_WeaponIcon = 
{
    userData = {}
}
registerWidget("MgHUD_WeaponIcon");


function MgHUD_WeaponIcon:draw()

    ------ Early out if HUD shouldn't be shown. ------
    if not shouldShowHUD() then return end
	if isRaceMode() then return end

    ------ GET PLAYER ------
    local player = getPlayer();


    ------ OPTIONS ------
    local iconSize = 30;

    ------ HELPERS ------
    local weaponIndex = player.weaponIndexSelected;
    local weapon = player.weapons[weaponIndex];
    local svgName = "internal/ui/icons/weapon"..weaponIndex;

    ------ DRAW ICON ------
    nvgFillColor(Color(64,64,64));
    nvgSvg(svgName, 0+1, 0+1, iconSize);

    nvgFillColor(weapon.color);
    nvgSvg(svgName, 0, 0, iconSize);


end
